float

/avail/Avail/Foundation/Bootstrap/Special Objects: float
Source: /avail/Avail/Foundation/Bootstrap/Special Objects
Categories: Primitives, Types, Numbers
Supertypes: number
A float — that is, an IEEE 754 single-precision floating point number — is an approximation of a real number. The representation uses 32 bits, organized as 1 sign bit, 23 bits of mantissa, and 8 bits of exponent. Finite float values range from -3.40282347e+38 to 3.40282347e+38. The closest to zero nonzero float values are ±1.40239846e-45. Positive zero ({@code 0.0 }) and negative zero ({@code -0.0 }) are considered distinct. Infinities are supported, but indicate an overflow of representational limits (rather than ±∞ ). Some encodings do not represent real values; such a value is a not-a-number ({@code NaN }). No two differing NaN encodings are considered equal. This is a departure from a strict interpretation of IEEE 754.

The float type is provided only for interoperation with the Java programming language. Use of float values is generally discouraged; prefer double values whenever possible. There is no syntax for specifying a literal float. Instead, use the method _→float to convert a double value to a float value.